<template>
	<view class="">
		<u-navbar title="开票历史"></u-navbar>
		<u-table>
			<u-tr>
				<u-td>{{$z.$t("时间")}}</u-td>
				<u-td>{{$z.$t("金额")}}</u-td>
				<u-td>{{$z.$t("缴费时间")}}</u-td>
			</u-tr>
			<u-tr v-for="item in LlfFP">
				<u-td>{{ item.sjc }}</u-td>
				<u-td>{{ item.je / 100 }}{{$z.$t("元")}}</u-td>
				<u-td>
					<text v-if="item.fpfile" class="dow" @click="dow(item)">{{$z.$t("下载")}}</text>
					<text v-else>{{$z.$t("开票中")}}</text>
				</u-td>
			</u-tr>
		</u-table>
		<!-- {{LlfAgentgtel}} -->
		<zmodal ref="zmodal"></zmodal>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				LlfFP: [],
			};
		},
		mounted() {
			this.init();
		},
		methods: {
			async init() {
				let USearch = await this.$store.dispatch("user/getuser");
				let LlfFP = await this.$z.request("/LlfFP", {
					uUser: USearch.uUser,
					fptype: 1,
				});
				let LlfFPs = await this.$z.request("/LlfFP", {
					uUser: USearch.uUser,
					fptype: 2,
				});
				let arr = [...LlfFP, ...LlfFPs]
				this.LlfFP = arr.reverse();
			},
			dow(item) {
				window.location.href = item.fpfile;
			},
		},
	};
</script>

<style>
	.dow {
		color: #2093f5;
	}
</style>